-- || Created by Revelse

VoteSystem = inherit(Singleton)
addEvent("activateVoteSystem",true)
addEvent("deactivateVoteSystem",true)
addEvent("showVoteSystem",true)
addEvent("hideVoteSystem",true)
addEvent("reciveVoteSystemMaps", true)

function VoteSystem:constructor()
	self.m_Active = false
	self.m_Maps   = {}
	
	addEventHandler("activateVoteSystem", root, bind(self.setActive,self))
	addEventHandler("deactivateVoteSystem", root, bind(self.setInactive,self))
	addEventHandler("reciveVoteSystemMaps", root, bind(self.reciveMaps,self))
	addEventHandler("onClientRender", root, bind(self.draw,self))
end

function VoteSystem:reciveMaps(maps)
	self.m_Maps = maps or {}
end

function VoteSystem:setActive()
	self.m_Active = true
end

function VoteSystem:setInactive()
	self.m_Active = false
end

function VoteSystem:draw()
	if not self.m_Active then
		return
	end
	for key, value in ipairs(self.m_Maps) do
		dxDrawText(value,screenWidth/2,100+(key*25))
	end
end

function VoteSystem:destructor()
end
